home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16552 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: grimsel.zurich.ibm.com!usenet
  2. From: wgk@zurich.ibm.com (Keith Whittingham)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Far Calls
  5. Date: 11 Apr 1996 08:42:51 GMT
  6. Organization: IBM Research, ZRH
  7. Message-ID: <4kigmb$11q9@grimsel.zurich.ibm.com>
  8. References: <4kgvf1$891@ttacs7.ttu.edu>
  9. Reply-To: wgk@zurich.ibm.com
  10. NNTP-Posting-Host: pine.zurich.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.00
  12.  
  13. In <4kgvf1$891@ttacs7.ttu.edu>, talleyj@hub.ofthe.net (Jason) writes:
  14. >For any CS Majors, Junior and above...
  15. >    How do you make a far call to a SPECIFIC address in C/C++.  We must
  16. >write a monitor for class, with the ability to modify EXACT memory
  17. >locations and execute the code from a given location.  Also, is anyone
  18. >familar with the REGISTER command?  It says it will load the value
  19. >directly into a register, IF POSSIBLE.  Now, does this if possible
  20. >give you a indicator that it has?  If not, is there a way TO ALWAYS
  21. >load into a register.  This program is basically supposed to be MS
  22. >DEGUB but designed and written by us.  So far, these are the only 2
  23. >stumbles I have come across.
  24.  
  25. Far calls: do you really want to do this, can you tell that the 
  26. linkage of the called location is correct. The 'standard' PC way (and
  27. I use the word standard loosly) is to load an interrupt vector with
  28. the address of a routine that needs calling and generate a software
  29. interrupt (e.g. int86)..
  30.  
  31. Register: I think you're misinterpreting the keyword. Register is 
  32. used for optimisation purposes. Using the register modifier tells
  33. the compiler that this variable is being used a lot and it should
  34. keep it in any register it chooses (if it can) to make things 
  35. operate faster.
  36.  
  37. If you want to load registers and call functions directly then 
  38. either use int86 or use inline assembler.
  39.  
  40. Keith
  41.  
  42.  
  43.  
  44.